package com.flyxiaozhu.erp.core.helper;

import java.util.Random;

public class RandomStringGenerateHelper {

    public static String getRandomString(int length) { //length表示生成字符串的长度
        String base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.+@!%-";
        Random random = new Random();
        StringBuffer password = new StringBuffer();
        for (int i = 0; i < length; i++) {
            int number = random.nextInt(base.length());
            password.append(base.charAt(number));
        }
        return password.toString();
    }

}
